#ifndef InclusionGuard_SoundPotVstInstrumentFactory_h
#define InclusionGuard_SoundPotVstInstrumentFactory_h


#include "SoundPotVstInstrument.h"
#include "SoundPotSoundTypeSpecificInstrumentFactory.h"
#include "pluginterfaces/vst2.x/aeffectx.h"
#include <string>
#include <map>



namespace SoundPot
{

	class VstInstrumentFactory : public SoundTypeSpecificInstrumentFactory
	{


	public:

		~VstInstrumentFactory();

		Instrument* createInstrument(const std::string& instrumentID) {return 0;};
		Instrument* createNewInstrument(Sound::Type soundType) {return 0;};

		
		static VstInstrumentFactory* getInstance();



		/// The real, object oriented vstHostCallback() function.
		// VSTCALLBACK is AFAIK only a platform independent name for a calling convention (like __cdecl on Win32)
		VstIntPtr VSTCALLBACK pluginToHostCallback (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);


		/// Static host callback
		/*	That one is needed by VST Plugins to send messages to the host.
			Unfortunately, it's not possible to let a VST Plugin directly call the real object method
			vstHostCallback() because a VST Plugin needs a normal function pointer and doesn't accept a method pointer.
			So I introduced additionally staticVstHostCallback() as a static function, that means it will be called in 
			a global context rather than in an object context.
			The implementation of this function doesn't do anything else than forwarding the function call to
			a real method, called in an object context.
		*/
		static VstIntPtr VSTCALLBACK staticPluginToHostCallback (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);



	private:
		
		VstInstrumentFactory();
			
		
		/// Single instance is hold here
		static VstInstrumentFactory* instance;
	};

}

#endif